<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
  <meta name="generator" content=
  "HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org">

  <title>C++ Lists</title>
  <link href="../cppreference.css" rel="stylesheet" type="text/css">
</head>

<body>
<table>
  <tr>
  <td>
  <div class="body-content">

  <div class="header-box">
    <a href="../index.html">cppreference.com</a> &gt; <a href=
    "index.html">C++ Lists</a>
  </div>

  <div class="name-format">
    C++ Lists
  </div>

  <p>Lists are sequences of elements stored in a linked list. Compared
  to vectors, they allow fast insertions and deletions, but slower
  random access.</p>

  <p><a href="all.html">Display all entries</a> for C++ Lists on one
  page, or view entries individually:</p>

  <table class="category-table">
    <tr class="category-table-tr-2">
      <td class="category-table-td"><a href=
      "container_constructors2.html">Container constructors</a></td>

      <td class="category-table-td">create lists and initialize them
      with some data</td>
    </tr>

    <tr class="category-table-tr-1">
      <td class="category-table-td"><a href=
      "container_operators.html">Container operators</a></td>

      <td class="category-table-td">assign and compare lists</td>
    </tr>

    <tr class="category-table-tr-2">
      <td class="category-table-td"><a href=
      "assign.html">assign</a></td>

      <td class="category-table-td">assign elements to a list</td>
    </tr>

    <tr class="category-table-tr-1">
      <td class="category-table-td"><a href="back.html">back</a></td>

      <td class="category-table-td">returns a reference to last element
      of a list</td>
    </tr>

    <tr class="category-table-tr-2">
      <td class="category-table-td"><a href="begin.html">begin</a></td>

      <td class="category-table-td">returns an iterator to the
      beginning of the list</td>
    </tr>

    <tr class="category-table-tr-1">
      <td class="category-table-td"><a href="clear.html">clear</a></td>

      <td class="category-table-td">removes all elements from the
      list</td>
    </tr>

    <tr class="category-table-tr-2">
      <td class="category-table-td"><a href="empty.html">empty</a></td>

      <td class="category-table-td">true if the list has no
      elements</td>
    </tr>

    <tr class="category-table-tr-1">
      <td class="category-table-td"><a href="end.html">end</a></td>

      <td class="category-table-td">returns an iterator just past the
      last element of a list</td>
    </tr>

    <tr class="category-table-tr-2">
      <td class="category-table-td"><a href="erase.html">erase</a></td>

      <td class="category-table-td">removes elements from a list</td>
    </tr>

    <tr class="category-table-tr-1">
      <td class="category-table-td"><a href="front.html">front</a></td>

      <td class="category-table-td">returns a reference to the first
      element of a list</td>
    </tr>

    <tr class="category-table-tr-2">
      <td class="category-table-td"><a href=
      "insert.html">insert</a></td>

      <td class="category-table-td">inserts elements into the list</td>
    </tr>

    <tr class="category-table-tr-1">
      <td class="category-table-td"><a href=
      "max_size.html">max_size</a></td>

      <td class="category-table-td">returns the maximum number of
      elements that the list can hold</td>
    </tr>

    <tr class="category-table-tr-2">
      <td class="category-table-td"><a href="merge.html">merge</a></td>

      <td class="category-table-td">merge two lists</td>
    </tr>

    <tr class="category-table-tr-1">
      <td class="category-table-td"><a href=
      "pop_back.html">pop_back</a></td>

      <td class="category-table-td">removes the last element of a
      list</td>
    </tr>

    <tr class="category-table-tr-2">
      <td class="category-table-td"><a href=
      "pop_front.html">pop_front</a></td>

      <td class="category-table-td">removes the first element of the
      list</td>
    </tr>

    <tr class="category-table-tr-1">
      <td class="category-table-td"><a href=
      "push_back.html">push_back</a></td>

      <td class="category-table-td">add an element to the end of the
      list</td>
    </tr>

    <tr class="category-table-tr-2">
      <td class="category-table-td"><a href=
      "push_front.html">push_front</a></td>

      <td class="category-table-td">add an element to the front of the
      list</td>
    </tr>

    <tr class="category-table-tr-1">
      <td class="category-table-td"><a href=
      "rbegin.html">rbegin</a></td>

      <td class="category-table-td">returns a <a href=
      "../iterators.html">reverse_iterator</a> to the end of the
      list</td>
    </tr>

    <tr class="category-table-tr-2">
      <td class="category-table-td"><a href=
      "remove.html">remove</a></td>

      <td class="category-table-td">removes elements from a list</td>
    </tr>

    <tr class="category-table-tr-1">
      <td class="category-table-td"><a href=
      "remove_if.html">remove_if</a></td>

      <td class="category-table-td">removes elements conditionally</td>
    </tr>

    <tr class="category-table-tr-2">
      <td class="category-table-td"><a href="rend.html">rend</a></td>

      <td class="category-table-td">returns a <a href=
      "../iterators.html">reverse_iterator</a> to the beginning of the
      list</td>
    </tr>

    <tr class="category-table-tr-1">
      <td class="category-table-td"><a href=
      "resize.html">resize</a></td>

      <td class="category-table-td">change the size of the list</td>
    </tr>

    <tr class="category-table-tr-2">
      <td class="category-table-td"><a href=
      "reverse.html">reverse</a></td>

      <td class="category-table-td">reverse the list</td>
    </tr>

    <tr class="category-table-tr-1">
      <td class="category-table-td"><a href="size.html">size</a></td>

      <td class="category-table-td">returns the number of items in the
      list</td>
    </tr>

    <tr class="category-table-tr-2">
      <td class="category-table-td"><a href="sort.html">sort</a></td>

      <td class="category-table-td">sorts a list into ascending
      order</td>
    </tr>

    <tr class="category-table-tr-1">
      <td class="category-table-td"><a href=
      "splice.html">splice</a></td>

      <td class="category-table-td">merge two lists in <a href=
      "../complexity.html">constant time</a></td>
    </tr>

    <tr class="category-table-tr-2">
      <td class="category-table-td"><a href="swap.html">swap</a></td>

      <td class="category-table-td">swap the contents of this list with
      another</td>
    </tr>

    <tr class="category-table-tr-1">
      <td class="category-table-td"><a href=
      "unique.html">unique</a></td>

      <td class="category-table-td">removes consecutive duplicate
      elements</td>
    </tr>
  </table>
  </div>
  </td>
  


  </tr>
  </table>
</body></html>
